<template>
  <div class="GoosJList">
      <!-- 商品组件 -->
      <ul>
        <li
          v-for="item in goodsList"
          :key="item.id"
          @click="gotoDetail(item.id)"
        >
          <img :src="item.list_pic_url" alt="" />
          <p>{{ item.name }}</p>
          <span>￥{{ item.retail_price }}.00元</span>
        </li>
      </ul>
  </div>
</template>

<script>
export default {
  name: "GoosJList",
  props: ["goodsList"],
  data() {
    return {

    };
  },

  components: {},

  computed: {},

  created() {},

  mounted() {},

  methods: {
    gotoDetail(id) {
      console.log(id);
      this.$router.push({ path: "/productDetail", query: { id: id } });
    },
  },
};
</script>
<style lang='less' scoped>
.GoosJList {
  ul {
    display: flex;
    flex-wrap: wrap;
    padding: 3px;
    box-sizing: border-box;
    li {
      width: 50%;
      img {
        width: 100%;
      }
      p {
        font-size: 16px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      span {
        color: purple;
        font-size: 16px;
      }
    }
  }
}
</style>